package com.jiutong.meipenggang.http.model.requests;

import com.jiutong.meipenggang.http.RetrofitHandle;
import com.jiutong.meipenggang.http.SubscribeHandler;
import com.jiutong.meipenggang.http.model.services.MeiLiCaiService;

import java.util.Map;

import rx.Observable;
import rx.Subscriber;

/**
 * @author Veken
 * @date on 2017/12/19 10:35
 * @describe
 */

public class MeiLiCaiFragmentRequest extends SubscribeHandler {

    /**
     * 美理财frament信息
     */
    public void getMeiLiCaiFragmentInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getMeiLiCaiFragmentInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 美理财单个标的详细信息
     */
    public void getInvestDetailInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getInvestDetailInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 还款计划信息
     */
    public void getRepaymentPlanInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getRepaymentPlanInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 红包信息
     */
    public void getHongBaoInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getHongBaoInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 首页红包信息
     */
    public void getHomeHongBaoInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getHomeHongBaoInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 首页红包信息
     */
    public void getInvestRecordInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getInvestRecordInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 投资页面信息
     */
    public void getInvestMoneyInfo(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .getInvestMoneyInfo(fields);
        toSubscribe(observable, subscriber);
    }

    /**
     * 投资成功
     */
    public void investMoney(Subscriber subscriber, Map<String, Object> fields) {
        handleFields(fields);
        Observable observable = RetrofitHandle.getInstance().retrofit.create(MeiLiCaiService.class)
                .investMoney(fields);
        toSubscribe(observable, subscriber);
    }


}
